New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WebView] Implemented stopLoading #6886
Conversation
By analyzing the blame information on this pull request, we identified @mkonicek, @nicklockwood and @donyu to be potential reviewers. |
@agray86 updated the pull request. |
@agray86 updated the pull request. |
Why not just use |
@pglotov I hadn't noticed that prop when I wrote this. It looks like that's exactly what I'd want, but unfortunately it also looks like it's iOS only at the moment, at least according to the docs. That won't work for me as I'm aiming for both iOS and Android. |
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, RCTWebView *> *viewRegistry) { | ||
RCTWebView *view = viewRegistry[reactTag]; | ||
if (![view isKindOfClass:[RCTWebView class]]) { | ||
RCTLogError(@"Invalid view returned from registry, expecting RCTWebView, got: %@", view); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoa this is a lot of duplication in all the methods but I see it's already there in the rest of the file :/
Seems simple enough even for me to review the Obj-C code :) @facebook-github-bot shipit |
Thanks for importing. If you are an FB employee go to Phabricator to review. |
774296b
Summary:**Motivation:** In my app, I'm using a WebView that loads content from my mobile site. What I want to do is when a user presses a link on the loaded page, I want to stop the WebView's request, hijack the URL and open the URL in a new WebView, pushed to the top of the navigator stack. To me, this gives the overall app a more native feel, instead of implementing a rudimentary navbar on the main WebView to go back. **Attempted Workarounds:** I've attempted to get similar functionality by capturing the onNavigationStateChange event in the WebView, and then within calling goBack + pushing the new view to the navigator stack. From a functionality standpoint, this works. However, from a UI standpoint, the user can clearly see the webview change states to a new page + go back before having the new view pushed on top of their nav stack. Closes facebook#6886 Differential Revision: D3212447 Pulled By: mkonicek fb-gh-sync-id: 05911e583d9ba54ddbd54a772153c80ed227731e fbshipit-source-id: 05911e583d9ba54ddbd54a772153c80ed227731e
Summary:**Motivation:** In my app, I'm using a WebView that loads content from my mobile site. What I want to do is when a user presses a link on the loaded page, I want to stop the WebView's request, hijack the URL and open the URL in a new WebView, pushed to the top of the navigator stack. To me, this gives the overall app a more native feel, instead of implementing a rudimentary navbar on the main WebView to go back. **Attempted Workarounds:** I've attempted to get similar functionality by capturing the onNavigationStateChange event in the WebView, and then within calling goBack + pushing the new view to the navigator stack. From a functionality standpoint, this works. However, from a UI standpoint, the user can clearly see the webview change states to a new page + go back before having the new view pushed on top of their nav stack. Closes facebook#6886 Differential Revision: D3212447 Pulled By: mkonicek fb-gh-sync-id: 05911e583d9ba54ddbd54a772153c80ed227731e fbshipit-source-id: 05911e583d9ba54ddbd54a772153c80ed227731e
Summary:**Motivation:** In my app, I'm using a WebView that loads content from my mobile site. What I want to do is when a user presses a link on the loaded page, I want to stop the WebView's request, hijack the URL and open the URL in a new WebView, pushed to the top of the navigator stack. To me, this gives the overall app a more native feel, instead of implementing a rudimentary navbar on the main WebView to go back. **Attempted Workarounds:** I've attempted to get similar functionality by capturing the onNavigationStateChange event in the WebView, and then within calling goBack + pushing the new view to the navigator stack. From a functionality standpoint, this works. However, from a UI standpoint, the user can clearly see the webview change states to a new page + go back before having the new view pushed on top of their nav stack. Closes facebook#6886 Differential Revision: D3212447 Pulled By: mkonicek fb-gh-sync-id: 05911e583d9ba54ddbd54a772153c80ed227731e fbshipit-source-id: 05911e583d9ba54ddbd54a772153c80ed227731e
Motivation: In my app, I'm using a WebView that loads content from my mobile site. What I want to do is when a user presses a link on the loaded page, I want to stop the WebView's request, hijack the URL and open the URL in a new WebView, pushed to the top of the navigator stack. To me, this gives the overall app a more native feel, instead of implementing a rudimentary navbar on the main WebView to go back.
Attempted Workarounds: I've attempted to get similar functionality by capturing the onNavigationStateChange event in the WebView, and then within calling goBack + pushing the new view to the navigator stack. From a functionality standpoint, this works. However, from a UI standpoint, the user can clearly see the webview change states to a new page + go back before having the new view pushed on top of their nav stack.